package meiju;

import java.util.Objects;

/**
 * @author
 * @Title: StatusEnum
 * @Description:
 * @date 2022/5/27 11:25 上午
 */
public enum StatusEnum {

    OK(1),NG(2);

    public int code;

    StatusEnum(int code){
        this.code = code;
    }

    public static Integer getCode(String name){
        for(StatusEnum ele:values()){
            if(Objects.equals(ele.name(),name)){
                return ele.getCode();
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
